package router

import (
	"github.com/gin-gonic/gin"
	"video/api/handle"
	"video/api/middleware"
)

func Router(r *gin.Engine) {
	r.Use(middleware.Cors()) //默认跨域
	api := r.Group("/api")
	{
		upload := api.Group("/upload")
		{
			upload.POST("/upload", handle.Upload)
		}
		video := api.Group("/video")
		{
			video.POST("add", handle.VideoAdd)
			video.POST("modify", handle.VideoModify)
			video.POST("list", handle.VideoList)
		}
	}

}
